package com.huashi.dealer.modular.business.article.param;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.time.LocalDateTime;
import java.util.List;

/**
 * API文章响应参数
 *
 * @author 谭陈强
 * @since 2025-07-30
 */
@Data
@Schema(description = "API文章响应参数")
public class ArticleResponseParam {

    @Schema(description = "文章列表")
    private List<ArticleInfo> articleList;

    @Schema(description = "分类列表")
    private List<CategoryInfo> categoryList;

    @Schema(description = "文章详情")
    private ArticleInfo articleDetail;

    @Schema(description = "总数")
    private Long total;

    @Schema(description = "当前页")
    private Integer currentPage;

    @Schema(description = "每页数量")
    private Integer perPage;

    @Schema(description = "最后页")
    private Integer lastPage;

    @Data
    @Schema(description = "文章信息")
    public static class ArticleInfo {
        @Schema(description = "文章ID")
        private Long articleId;

        @Schema(description = "文章标题")
        private String articleTitle;

        @Schema(description = "文章内容")
        private String articleContent;

        @Schema(description = "显示类型")
        private Integer showType;

        @Schema(description = "分类ID")
        private Long categoryId;

        @Schema(description = "图片ID")
        private Long imageId;

        @Schema(description = "文章排序")
        private Integer articleSort;

        @Schema(description = "文章状态")
        private Integer articleStatus;

        @Schema(description = "小程序ID")
        private Long wxappId;

        @Schema(description = "创建时间")
        private LocalDateTime createTime;

        @Schema(description = "更新时间")
        private LocalDateTime updateTime;

        @Schema(description = "图片信息")
        private ImageInfo image;

        @Schema(description = "分类信息")
        private CategoryInfo category;
    }

    @Data
    @Schema(description = "分类信息")
    public static class CategoryInfo {
        @Schema(description = "分类ID")
        private Long categoryId;

        @Schema(description = "分类名称")
        private String name;

        @Schema(description = "分类排序")
        private Integer sort;

        @Schema(description = "小程序ID")
        private Long wxappId;

        @Schema(description = "创建时间")
        private LocalDateTime createTime;

        @Schema(description = "更新时间")
        private LocalDateTime updateTime;

        @Schema(description = "文章列表")
        private List<ArticleInfo> list;
    }

    @Data
    @Schema(description = "图片信息")
    public static class ImageInfo {
        @Schema(description = "文件ID")
        private Long fileId;

        @Schema(description = "存储方式")
        private String storage;

        @Schema(description = "分组ID")
        private Long groupId;

        @Schema(description = "文件URL")
        private String fileUrl;

        @Schema(description = "文件名称")
        private String fileName;

        @Schema(description = "文件大小")
        private Long fileSize;

        @Schema(description = "文件类型")
        private String fileType;

        @Schema(description = "创建时间")
        private LocalDateTime createTime;

        @Schema(description = "更新时间")
        private LocalDateTime updateTime;
    }
} 